
import request from '@/utils/request'

// 新建
export function create(data) {
  return request({
    url: '/api/v1/dept',
    method: 'post',
    data: data
  })
}

// 获取分页list
export function getPageList(data) {
  return request({
    url: '/api/v1/dict',
    method: 'get',
    params: data
  })
}

// 获取分页list
export function getListTree() {
  return request({
    url: '/api/v1/deptTree',
    method: 'get'
  })
}

// 获取详情
export function deptDetailById(data) {
  return request({
    url: '/api/v1/deptDetailById',
    method: 'get',
    params: data
  })
}

// 修改
export function update(data) {
  return request({
    url: '/api/v1/dept',
    method: 'put',
    data: data
  })
}

// 删除
export function deleteDept(data) {
  return request({
    url: '/api/v1/dept/' + data,
    method: 'delete'
  })
}

// 批量删除
export function deletesDict(data) {
  return request({
    url: '/api/v1/dict',
    method: 'delete',
    data: data
  })
}
